package imv3.foo.client.console;

import imv3.protocol.request.MessageRequestPacket;
import io.netty.channel.Channel;

import java.util.Scanner;

/**
 * @author @xsomnus666_xiawenye★
 * @since 2019/4/26 0026 9:47
 * 当你发现自己的才华撑不起野心时，就请安静下来学习吧
 */
public class SendToUserCommand implements ConsoleCommand {

    @Override
    public void exec(Scanner scanner, Channel channel) {
        System.out.print("发送消息给某个用户:");
        String toUserId = scanner.next();
        String message = scanner.next();

        channel.writeAndFlush(new MessageRequestPacket(toUserId, message));
    }
}
